package com.seadragon.app.ksr.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.seadragon.app.ksr.dao.EventDao;
import com.seadragon.app.ksr.model.Business;
import com.seadragon.app.ksr.model.Event;
import com.seadragon.app.ksr.service.EventService;

@Service("eventService")
@Transactional
public class EventServiceImpl implements EventService {

	@Autowired
	private EventDao eventDao;
	
	@Override
	public void save(Event event) {
		eventDao.save(event);
	}

	@Override
	public List<Event> findAllEventsBy(Business business) {
		return eventDao.findAllBy(business);
	}

	@Override
	public Event update(Event event) {
		
		return eventDao.update(event);
	}

	@Override
	public Event findById(long id) {
		return eventDao.findById(id);
	}

	@Override
	public List<Event> findAll(int offset, int pageSize) {
		return eventDao.findAll(offset, pageSize);
	}

	@Override
	public List<Event> findAllBy(Business business, int offset, int pageSize) {
		return eventDao.findAllBy(business, offset, pageSize);
	}

}
